package com.weavernorth.sysap.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import weaver.conn.RecordSet;
import weaver.formmode.setup.ModeRightInfo;

public class ModeDataShareByThreads implements Runnable {
	//数据库操作
    RecordSet rs = new RecordSet();
	//模块id
	private int modeid;
	//sql语句
	private String sql;
	//Log的类
    Log log = LogFactory.getLog(ModeDataShareByThreads.class);

	@Override
	public void run() {
		//权限重构
	    rs.execute(sql);
	    log.info("查询需要权限重构的id sql:" + sql);
	    int billid;
	    while (rs.next()) {
	        billid = rs.getInt("id"); // 表单建模数据ID
	        int Creater = 1;
	        ModeRightInfo modeRightInfoBanc = new ModeRightInfo();
	        modeRightInfoBanc.setNewRight(true);
	        modeRightInfoBanc.editModeDataShare(Creater, modeid, billid);// 新建的
	    }
		
	}

	public int getModeid() {
		return modeid;
	}

	public void setModeid(int modeid) {
		this.modeid = modeid;
	}

	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}
}
